package chapter01

class Student(name: String, var age: Int) {

  def printInfo(): Unit = {
    println(name + " " + age + " " + Student.school)
  }
}


//伴生对象
object Student {
  var school: String = "atguigu";

  def main(args: Array[String]): Unit = {
  val name0 = new Student("张三",20)
  val name1 = new Student("王五",20)

    name0.printInfo()
    name1.printInfo()
  }
}


